package com.pro.common.api.depencies.model.mapstruct;

import com.pro.common.api.depencies.config.CommonMappingConfig;
import com.pro.common.api.model.ILoginInfo;
import com.pro.common.api.model.IUserClass;
import com.pro.common.api.model.IUserIdClass;
import io.swagger.v3.oas.annotations.media.Schema;
import org.mapstruct.*;


@Schema(description = "登录信息")
@Mapper(
        componentModel = "spring",
        config = CommonMappingConfig.class,
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE
)
public interface LoginInfoMapper {

    @InheritConfiguration(name = "ignoreBaseFields")
    @Mapping(source = "id", target = "userId")
    void update(ILoginInfo source, @MappingTarget IUserClass target);
}
